import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

// 创建一个 store
const store = new Vuex.Store({
  // (1)初始 state 对象
  state:{
    result: '',
    openOccupationStatus: false,
    systemObj: {},
    payStatus: false,
    mbtiResultObj: {},
    userInfo: {}
  },
  getters:{
    getMbtiResultObj: state => state.mbtiResultObj,
  },
  // (2)定义一些mutation
  mutations:{
    setResult(state,company){
      state.result = company;
    },
    setUserInfo(state,company) {
      state.userInfo = company;
    },
    setSystemObj(state,company) {
      state.systemObj = company;
    },
    setOpenOccupationStatus(state,company) {
      state.openOccupationStatus = company;
    },
    setPayStatus(state,company) {
      state.payStatus = company;
    },
    setMbtiResultObj(state,company) {
      console.log(company)
      state.mbtiResultObj = company
    }
  }
})

// 导出该模块:以便其他文件可对其进行使用
export default store
